package com.qijian.production.domain;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.qijian.common.enums.ApprovalDescriptionEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qijian.common.annotation.Excel;
import com.qijian.common.core.domain.BaseEntity;

/**
 * 生产计划单工序对象 sc_work_order_detail
 *
 * @author zhangcheng
 * @date 2025-03-25
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ToString
@TableName("sc_work_order_detail")
public class ScWorkOrderDetail extends BaseEntity{
    private static final long serialVersionUID = 1L;

    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "唯一id")
    private Long id;

    @Excel(name = "工单id")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "工单id")
    private Long workOrderId;

    @Excel(name = "工序id")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "工序id")
    private Long processId;

    /**
     * 工单详情编号
     */
    private String detailNo;

    @Excel(name = "工序名称")
    @ApiModelProperty(value = "工序名称")
    private String processName;

    @Excel(name = "排序号")
    @ApiModelProperty(value = "排序号")
    private Integer sort;

    @Excel(name = "工序编码")
    @ApiModelProperty(value = "工序编码")
    private String processCode;

    @Excel(name = "配比")
    @ApiModelProperty(value = "配比")
    private BigDecimal proportion;

    @Excel(name = "工艺路线id")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "工艺路线id")
    private Long lineProcessId;

    @Excel(name = "工单数量")
    @ApiModelProperty(value = "工单数量")
    private BigDecimal qty;

    @Excel(name = "报工数量")
    @ApiModelProperty(value = "报工数量")
    private BigDecimal producedQty;

    /**
     * 生产位置id
     */
    private Long locationId;

    /**
     * 生产位置
     */
    private String location;

    /**
     * 订单号
     */
    private String orderNo;

    /**
     * 工单状态
     */
    private String status;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date startDate;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date endDate;

    @TableField(exist = false)
    List<ScWorkOrderCraftItem> workOrderCraftItemList;

}
